﻿<UserControl x:Class="KarateSemaphore.SemaphoreViewInverse"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:vm="clr-namespace:KarateSemaphore"
             xmlns:core="clr-namespace:KarateSemaphore.Core;assembly=KarateSemaphore.Core"
             mc:Ignorable="d" 
        d:DataContext="{d:DesignInstance core:SemaphoreViewModel, IsDesignTimeCreatable=True}"
        d:DesignHeight="300" d:DesignWidth="582">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Style.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid Background="{StaticResource ResourceKey=panelBackground}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="9*"/>
            <ColumnDefinition Width="4*"/>
            <ColumnDefinition Width="9*"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*" />
            <RowDefinition Height="5*" />
            <RowDefinition Height="1*" />
            <RowDefinition Height="1*"/>
            <RowDefinition Height="3*" />
        </Grid.RowDefinitions>

        <Border Grid.Column="0" Grid.RowSpan="5" Background="{Binding Source={StaticResource ao}}"></Border>
        <Border Grid.Column="4" Grid.RowSpan="5" Background="{Binding Source={StaticResource aka}}"></Border>

        <Viewbox Grid.Column="1" Grid.Row="0">
            <TextBlock Text="{Binding Path=Ao.DisplayText}" Style="{StaticResource ResourceKey=panelText}" TextAlignment="Center"/>
        </Viewbox>
        <Viewbox Grid.Column="3" Grid.Row="0">
            <TextBlock Text="{Binding Path=Aka.DisplayText}" Style="{StaticResource ResourceKey=panelText}" TextAlignment="Center"/>
        </Viewbox>
        
        <Viewbox Grid.Column="1" Grid.Row="1">
            <TextBlock Text="{Binding Path=Ao.Points}" Style="{StaticResource ResourceKey=panelText}"/>
        </Viewbox>
        <Viewbox Grid.Column="3" Grid.Row="1">
            <TextBlock Text="{Binding Path=Aka.Points}" Style="{StaticResource ResourceKey=panelText}" />
        </Viewbox>

        <Viewbox Grid.Column="2" Grid.Row="2">
            <TextBlock Text="CAT.1"  Style="{StaticResource ResourceKey=panelText}" />
        </Viewbox>
        <Viewbox Grid.Column="2" Grid.Row="3">
            <TextBlock Text="CAT.2" Style="{StaticResource ResourceKey=panelText}" />
        </Viewbox>

        <Viewbox Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="3">
            <TextBlock Text="{Binding Time.Remaining, Mode=OneWay, StringFormat=\{0:mm\\:ss\\:ff\}}" Style="{StaticResource ResourceKey=panelText}" />
        </Viewbox>

        <vm:PenaltyDisplayControl Grid.Column="1" Grid.Row="2" Penalty="{Binding Path=Ao.C1}" ItemTemplate="{StaticResource ResourceKey=panelPenaltyItem}" />
        <vm:PenaltyDisplayControl Grid.Column="1" Grid.Row="3" Penalty="{Binding Path=Ao.C2}" ItemTemplate="{StaticResource ResourceKey=panelPenaltyItem}" />
        <vm:PenaltyDisplayControl Grid.Column="3" Grid.Row="2" Penalty="{Binding Path=Aka.C1}" ItemTemplate="{StaticResource ResourceKey=panelPenaltyItem}" />
        <vm:PenaltyDisplayControl Grid.Column="3" Grid.Row="3" Penalty="{Binding Path=Aka.C2}" ItemTemplate="{StaticResource ResourceKey=panelPenaltyItem}" />
    </Grid>
</UserControl>
